package ro.xblue.translator;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 * Created by IntelliJ IDEA.
 * User: xblue
 * Date: May 14, 2004
 * Time: 1:14:26 AM
 * To change this template use File | Settings | File Templates.
 */
public class ReloadTranslator$Action extends Action {
	public ActionForward execute(ActionMapping mapping,
						    ActionForm form,
						    HttpServletRequest request,
						    HttpServletResponse response)
		  throws Exception {
		Translator_DB translator_db = (Translator_DB) getServlet().getServletContext().
			  getAttribute(TranslatorConstants.DB_TRANSLATOR);
		if (translator_db == null) return mapping.findForward("finnish");
		translator_db.reloadModules();
		return mapping.findForward("finnish");
	}

}
